package ljye.com.ljye.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import java.util.List;

import ljye.com.ljye.R;

/**
 * Created by Administrator on 2016/12/28.
 * 横向滑动adapter
 */

public class GridViewAdapter extends BaseAdapter {
    Context context;
    List<String> list;

    public GridViewAdapter(Context _context, List<String> _list) {
        this.list = _list;
        this.context = _context;
    }


    @Override
    public int getCount() {
        return list.size();
    }

    public void setContext(Context context) {
        this.context = context;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    @Override

    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        convertView = layoutInflater.inflate(R.layout.enclosure_school_item, null);

        ImageView ItemImage = (ImageView) convertView.findViewById(R.id.ItemImage);

        return convertView;
    }
}

